﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;

namespace 第二次作业
{
    class Program
    {
        static void Main(string[] args)
        {
            //打印直角三角形
            Console.WriteLine("请输入行数");
            int rows = int.Parse(Console.ReadLine());
            for (int i = 1; i <= rows; i++)
            {
                for (int j = 1; j <= i; j++)
                {
                    Console.Write("*");
                }
                Console.WriteLine();
            }
            Console.WriteLine("按回车键继续");
            Console.ReadKey();


            //打印倒等腰三角形
            for (int i = rows; i > 0; i--)
            {
                for (int j = 0; j < rows - i; j++)
                {
                    Console.Write(" ");
                }
                for (int k = 0; k < 2 * i - 1; k++)
                {
                    Console.Write("*");
                }
                Console.WriteLine();
            }
            Console.WriteLine("按回车键继续");
            Console.ReadKey();


            //打印菱形
            for (int i = 1; i <= rows; i++)
            {
                for (int j = rows - i; j > 0; j--)
                {
                    Console.Write(" ");
                }
                for (int k = 1; k <= 2 * i - 1; k++)
                {
                    Console.Write("*");
                }
                Console.WriteLine();
            }

            for (int n = rows - 1; n > 0; n--)
            {
                for (int m = 1; m <= rows - n; m++)
                {
                    Console.Write(" ");
                }
                for (int p = 1; p < 2 * n; p++)
                {
                    Console.Write("*");
                }
                Console.WriteLine();
            }
            Console.WriteLine("按回车键继续");
            Console.ReadKey();


            //打印空心菱形
            for (int i = 1; i <= rows; i++)
            {
                for (int j = rows - i; j > 0; j--)
                {
                    Console.Write(" ");
                }
                if (i == 1)
                    Console.WriteLine("*");
                else
                {
                    Console.Write("*");
                    for (int k = 1; k <= 2 * i - 3; k++)
                    {
                        Console.Write(" ");
                    }
                    Console.WriteLine("*");
                }
            }
            for (int i = rows - 1; i > 0; i--)
            {
                for (int j = 1; j <= rows - i; j++)
                {
                    Console.Write(" ");
                }
                if (i == 1)
                    Console.WriteLine("*");
                else
                {
                    Console.Write("*");
                    for (int k = 0; k < 2 * i - 3; k++)
                    {
                        Console.Write(" ");
                    }
                    Console.WriteLine("*");
                }


            }
            Console.WriteLine("按回车键结束");
            Console.ReadKey();
        }
    }
}
